/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.park.entity;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 日历
 *
 * @author pig
 * @date 2024-01-22 14:31:55
 */
@Data
@TableName("base_calendar")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "日历")
public class BaseCalendarEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 日期
     */
    @Schema(description = "日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date dateDate;

    /**
     * 日期类型
     */
    @Schema(description = "日期类型")
    private Integer dateType;

    /**
     * 标签
     */
    @Schema(description = "标签")
    private String dateLabel;

    /**
     * 农历
     */
    @Schema(description = "农历")
    private String chineseCalendar;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remarks;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    public String getDateDateStr() {

        return DateUtil.format(this.dateDate, DatePattern.NORM_DATE_PATTERN);
    }

    public Integer getDayOfMonth() {
        return DateUtil.dayOfMonth(this.dateDate);
    }

}
